package com.college.common.pojo.ao;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 后台菜单表
 * </p>
 *
 * @author 小C工作室
 * @since 2020-08-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("ums_menu")
@ApiModel(value = "menu对象", description = "后台菜单表")
public class UmsMenu implements Serializable {

	private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	@ApiModelProperty(value = "父级ID")
	private Long parentId;

	@ApiModelProperty(value = "菜单名称")
	private String title;

	@ApiModelProperty(value = "菜单排序")
	private Integer sort;

	@ApiModelProperty(value = "前端名称")
	private String name;

	@ApiModelProperty(value = "前端图标")
	private String icon;

	@ApiModelProperty(value = "组件名")
	private String component;

	@ApiModelProperty(value = "路径")
	private String path;

	@ApiModelProperty(value = "重定向路径")
	private String redirect;

	@ApiModelProperty(value = "元信息")
	@TableField(typeHandler = JacksonTypeHandler.class)
	private Meta meta;

	@ApiModel("元信息类")
	@Data
	static class Meta {
		@ApiModelProperty("标题")
		private String title;

		@ApiModelProperty("图标")
		private String icon;

		@ApiModelProperty("是否缓存路由")
		private Boolean keepAlive;

		@ApiModelProperty("是否隐藏头部内容")
		private Boolean hiddenHeaderContent;

		@ApiModelProperty("权限信息")
		private List<String> permission;

		@ApiModelProperty("是否隐藏头部")
		private Boolean hideHeader;

		@ApiModelProperty("是否隐藏子菜单")
		private Boolean hideChildrenInMenu;

		@ApiModelProperty("是否显示")
		private Boolean show;

		@ApiModelProperty("是否跳转")
		private String target;
	}
}
